<#include "header.htm"/>
<#import "../macros/pagination.ftl" as pagination>
<#import "../macros/presentation.ftl" as presentation/>

<script type="text/javascript" src="${contextPath}/templates/${templateName}/js/pagination.js?${startupTime}"></script>

<table cellspacing="0" cellpadding="1" width="100%" align="center" border="0">
	<tr>
		<td class="bodyline" valign="top">
 		
			<table cellspacing="0" cellpadding="2" width="100%" align="center" border="0">
				<tr>
					<td valign="bottom" align="left">
						<#assign breadCrumb>
							<a class="nav" href="${JForumContext.encodeURL("/forums/list")}">${I18n.getMessage("ForumListing.forumIndex")}</a> &raquo;
							<a class="nav" href="#">${searchTitle}</a> 
						</#assign>
						${breadCrumb}
					</td>
				</tr>
			</table>
 		
			<table class="forumline"  cellspacing="1" cellpadding="1" width="100%" border="0" >
				<tr>
				    <th class="thcornerl" nowrap="nowrap" align="center"   height="25">&nbsp;${I18n.getMessage("ForumBase.state")}&nbsp;</th>
					<th class="thtop"  align="center" >&nbsp;${I18n.getMessage("ForumIndex.topics")}&nbsp;</th>
	
					<th class="thtop" nowrap="nowrap" align="center" width="50">&nbsp;${I18n.getMessage("ForumIndex.answers")}&nbsp;</th>
					<th class="thtop" nowrap="nowrap" align="center" width="120">&nbsp;${I18n.getMessage("ForumIndex.author")}&nbsp;</th>
					<th class="thtop" nowrap="nowrap" align="center" width="50">&nbsp;${I18n.getMessage("ForumIndex.views")}&nbsp;</th>
					<th class="thcornerr" nowrap="nowrap"   align="center" width="120" >&nbsp;${I18n.getMessage("ForumIndex.lastMessage")}&nbsp;</th>
				</tr>

				<!-- TOPICS LISTING -->
				<#list topics as topic>				
                    <#assign rowbg><@presentation.rowbg topic /></#assign>
					<tr >
						<td  bgcolor="${rowbg}" valign="middle"  nowrap="nowrap" width="26" align="center" ><@presentation.folderImage topic/></td>
						<td bgcolor="${rowbg}" onmouseover="style.backgroundColor='#F5EFFB'" onmouseout="style.backgroundColor='${rowbg}'" >
 						
							<span class="topictitle">
							<a target="_blank" href="${JForumContext.encodeURL("/posts/list/${topic.id}")}">
							<#if topic.vote>${I18n.getMessage("ForumListing.pollLabel")}</#if>
							<#if (topic.title?length == 0)>
								没有主题
							<#else>
								${topic.title?html}
							</#if>
							</a>
							</span>
 			
						</td>

						<td bgcolor="${rowbg}" valign="middle"  align="center" ><span class="postdetails">${topic.totalReplies}</span></td>
						<td bgcolor="${rowbg}" valign="middle"  align="center" nowrap="nowrap">
							<span class="name">${topic.firstPostTime}</span><br/>
							<span class="name"><a href="${JForumContext.encodeURL("/user/profile/${topic.postedBy.id}")}" title="最后回复(${topic.lastPostBy.username}):${topic.lastPostText}">${topic.postedBy.username}</a></span>
							
						
						</td>

						<td bgcolor="${rowbg}" valign="middle"  align="center"><span class="postdetails">${topic.totalViews}</span></td>
						<td bgcolor="${rowbg}" valign="middle"  nowrap="nowrap" align="center">
							<#if (topic.lastPostTime?length > 0)>
								<span class="name">${topic.lastPostTime}<br />
								<a href="${JForumContext.encodeURL("/user/profile/${topic.lastPostBy.id}")}">${topic.lastPostBy.username}</a>

								<#assign startPage = ""/>
								<#if (topic.totalReplies + 1 > postsPerPage?number)>
									<#assign startPage = ((topic.totalReplies / postsPerPage?number)?int * postsPerPage?number) +"/"/>
								</#if>
								<a href="${JForumContext.encodeURL("/posts/list/${startPage}${topic.id}")}#${topic.lastPostId}"><img src="${contextPath}/templates/${templateName}/images/icon_latest_reply.gif" border="0" alt="[Latest Reply]" /></a></span>
							</#if>
						</td>
                     
					</tr>
				</#list>
				<!-- END OF TOPICS LISTING -->
 
			</table>
   ${breadCrumb}
		</td>
	</tr>
</table>
<#include "bottom.htm"/>
